package com.dff.jrfw.remote;


import com.dff.jrfw.requestBody.BindDeviceDto;
import com.dff.jrfw.requestBody.LoginDto;
import com.dff.jrfw.requestBody.MobileCertDto;
import com.dff.jrfw.requestBody.MobileDeviceDTO;
import com.dff.jrfw.requestBody.PasswordResetDto;
import com.dff.jrfw.requestBody.PsdUpdateDto;
import com.dff.jrfw.requestBody.QrCodeDto;
import com.dff.jrfw.requestBody.QueryUserPSApiDto;
import com.dff.jrfw.requestBody.SearchMuDeviceDto;
import com.dff.jrfw.requestBody.ValidatePwdApiDto;

import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.DELETE;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.Url;

public interface ApiService {

    @GET
    Call<ResponseBody> getAppVersions(@Url String url);


    //加密盐code
    @GET("bems/prod_1.0/uas/api/authorization/authorizationCode")
    Call<ResponseBody> getAuthCode(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc);


    //账号密码登录
    @POST("bems/prod_1.0/uas/api/authorization/login")
    Call<ResponseBody> doLogin(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body LoginDto loginDto);


    //短信验证码
    @GET("bems/prod_1.0/uas/api/authorization/captcha/{mobile}/{handleType}")
    Call<ResponseBody> sendSmsCode(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Path("mobile") String mobile, @Path("handleType") String handleType);


    //验证码校验
    @GET("bems/prod_1.0/uas/api/authorization/verify")
    Call<ResponseBody> doCodeVerify(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("mobile") String mobile, @Query("code") String code);


    //校验原始密码
    @POST("bems/prod_1.0/user/api/userController/validatePwd")
    Call<ResponseBody> validatePwd(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body ValidatePwdApiDto validatePwdApiDto);


    //密码修改
    @POST("bems/prod_1.0/uas/api/authorization/password/update")
    Call<ResponseBody> updatePsd(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body PsdUpdateDto psdUpdateDto);


    //用户第一次登录的时候忘记密码
    @POST("bems/prod_1.0/uas/api/authorization/password/reset")
    Call<ResponseBody> passwordReset(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body PasswordResetDto passwordResetDto);


    //用户设备绑定
    @POST("bems/prod_1.0/user/muDevice/bind/userDevice")
    Call<ResponseBody> bindDevice(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body BindDeviceDto bindDeviceDto);


    //用户设备解绑
    @PUT("bems/prod_1.0/user/muDevice/bind/delUserDevice")
    Call<ResponseBody> deBindDevice(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("deviceId") String deviceId, @Query("uno") String uno);


    //查询用户设备信息
    @POST("bems/prod_1.0/user/muDevice/Q001")
    Call<ResponseBody> queryDeviceInfo(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body SearchMuDeviceDto searchMuDeviceDto);


    //退出登录
    @DELETE("bems/prod_1.0/uas/api/authorization/logout")
    Call<ResponseBody> doLogout(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc);


    //查询在用用户基本信息
    @GET("bems/prod_1.0/user/api/userController/userCltAdDep/{username}")
    Call<ResponseBody> getUserBaseInfo(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Path("username") String username);

    //查询用户密码策略
    @POST("/bems/prod_1.0/user/api/userController/use")
    Call<ResponseBody> getPsdStrategy(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body QueryUserPSApiDto queryUserPSApiDto);


    //证书发送短信验证码
    @GET("maps/prod_1.0/maps/api/message/send")
    Call<ResponseBody> sendCertSmsCode(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("mobile") String mobile);


    //证书校验短信验证码
    @GET("maps/prod_1.0/maps/api/message/verify")
    Call<ResponseBody> verifyCertSmsCode(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("mobile") String mobile, @Query("code") String code);


    //获取授权码(信安签约码signCode)
    @GET("maps/prod_1.0/maps/api/certificate/authCode")
    Call<ResponseBody> getCerAuthCode(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("mobile") String mobile, @Query("checkCode") String checkCode);


    //获取Uid
    @GET("maps/prod_1.0/maps/api/certificate/getUid")
    Call<ResponseBody> getUserUid(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("uno") String uno);


    //证书作废之后，获取授权码(信安签约码signCode)
    @GET("maps/prod_1.0/maps/api/certificate/refreshCode")
    Call<ResponseBody> getRefreshCerAuthCode(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("uid") String uid);


    //用户账户是否激活
    @GET("maps/prod_1.0/maps/api/user/activity/{username}")
    Call<ResponseBody> doAccountIsAlive(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Path("username") String username);


    //证书作废  by  imei
    @GET("maps/prod_1.0/maps/api/certificate/revokeCert")
    Call<ResponseBody> deleteCertByImei(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("imei") String imei, @Query("otptype") String otptype, @Query("username") String username);


    //证书作废  by  uid
    @GET("maps/prod_1.0/maps/api/certificate/revokeCert")
    Call<ResponseBody> deleteCertByUid(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Query("uid") String uid);


    //    @PUT("/bems/prod_1.0/uas/api/qrCode")
    @PUT("bems/prod_1.0/uas/api/mobile/qrCode")
    Call<ResponseBody> qrCodeLogin(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body QrCodeDto qrCodeDto);

    @POST("/maps/prod_1.0/maps/api/user/saveCertificate")
    Call<ResponseBody> saveCertificate(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body MobileCertDto mobileCertDTO);

    @POST("/maps/prod_1.0/maps/api/user/saveDeviceID")
    Call<ResponseBody> saveDeviceID(@Header("requestKey") String requestKey, @Header("operationDesc") String operationDesc, @Body MobileDeviceDTO mobileDeviceDTO);
}
